package com.diandian.backend.store.param;

import com.diandian.backend.store.dto.MeituanShangouStoreAddParamDTO;
import com.diandian.base.boot.starter.exception.DefaultException;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

public class MeituanShangouStoreAddParam implements Serializable {

	private String offlineCode;
	private String onlineCode;
	private String onlineName;
	private String stauts;
	private String address;
	private String firstTag;
	private String callCenter;
	private String contactUserName;
	private String contactTel;
	private String ecommerceAccountPhone;
	private String shippingTime;
	private String lat;
	private String lng;
	private String remark;
	private String createUserId;
	private String createUserName;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	private String orgId;
	private String orgCode;
	private String belong;
	private String nodeCode;

	public void check(){
		if(this.offlineCode == null || "".equals(this.offlineCode)){
			throw new DefaultException("线下门店编码不能为空");
		}
		if(this.onlineCode == null || "".equals(this.onlineCode)){
			throw new DefaultException("线上门店编码不能为空");
		}
		if(this.onlineName == null || "".equals(this.onlineName)){
			throw new DefaultException("线上门店名称不能为空");
		}
		if(this.belong == null || "".equals(this.belong)){
			throw new DefaultException("归属不能为空");
		}
		if(this.nodeCode == null || "".equals(this.nodeCode)){
			throw new DefaultException("节点不能为空");
		}
	}

	public MeituanShangouStoreAddParamDTO toDTO(){
		MeituanShangouStoreAddParamDTO dto = new MeituanShangouStoreAddParamDTO();
		dto.setOfflineCode(this.offlineCode);
		dto.setOnlineCode(this.onlineCode);
		dto.setOnlineName(this.onlineName);
		dto.setStauts(this.stauts);
		dto.setAddress(this.address);
		dto.setFirstTag(this.firstTag);
		dto.setCallCenter(this.callCenter);
		dto.setContactUserName(this.contactUserName);
		dto.setContactTel(this.contactTel);
		dto.setEcommerceAccountPhone(this.ecommerceAccountPhone);
		dto.setShippingTime(this.shippingTime);
		dto.setLat(this.lat);
		dto.setLng(this.lng);
		dto.setRemark(this.remark);
		dto.setCreateUserId(this.createUserId);
		dto.setCreateUserName(this.createUserName);
		dto.setCreateTime(this.createTime);
		dto.setBelong(this.belong);
		dto.setNodeCode(this.nodeCode);
		dto.setOrgId(this.orgId);
		dto.setOrgCode(this.orgCode);
		return dto;
	}

	public String getOfflineCode() {
		return offlineCode;
	}

	public void setOfflineCode(String offlineCode) {
		this.offlineCode = offlineCode;
	}

	public String getOnlineCode() {
		return onlineCode;
	}

	public void setOnlineCode(String onlineCode) {
		this.onlineCode = onlineCode;
	}

	public String getOnlineName() {
		return onlineName;
	}

	public void setOnlineName(String onlineName) {
		this.onlineName = onlineName;
	}

	public String getStauts() {
		return stauts;
	}

	public void setStauts(String stauts) {
		this.stauts = stauts;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getFirstTag() {
		return firstTag;
	}

	public void setFirstTag(String firstTag) {
		this.firstTag = firstTag;
	}

	public String getCallCenter() {
		return callCenter;
	}

	public void setCallCenter(String callCenter) {
		this.callCenter = callCenter;
	}

	public String getContactUserName() {
		return contactUserName;
	}

	public void setContactUserName(String contactUserName) {
		this.contactUserName = contactUserName;
	}

	public String getContactTel() {
		return contactTel;
	}

	public void setContactTel(String contactTel) {
		this.contactTel = contactTel;
	}

	public String getEcommerceAccountPhone() {
		return ecommerceAccountPhone;
	}

	public void setEcommerceAccountPhone(String ecommerceAccountPhone) {
		this.ecommerceAccountPhone = ecommerceAccountPhone;
	}

	public String getShippingTime() {
		return shippingTime;
	}

	public void setShippingTime(String shippingTime) {
		this.shippingTime = shippingTime;
	}

	public String getLat() {
		return lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	public String getLng() {
		return lng;
	}

	public void setLng(String lng) {
		this.lng = lng;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(String createUserId) {
		this.createUserId = createUserId;
	}

	public String getCreateUserName() {
		return createUserName;
	}

	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getBelong() {
		return belong;
	}

	public void setBelong(String belong) {
		this.belong = belong;
	}

	public String getNodeCode() {
		return nodeCode;
	}

	public void setNodeCode(String nodeCode) {
		this.nodeCode = nodeCode;
	}
}
